﻿using System.Web.UI;
using System.Web.UI.WebControls;
using Axial;
using Axial.DOM;

namespace AxialWeb
{
	public partial class FirstTest : System.Web.UI.Page
	{
        public void MovePanel()
        {
			// if test
			if (pnlMoveMe.Width.Value < 400)
				pnlMoveMe.Width = new Unit(pnlMoveMe.Width.Value + 100, pnlMoveMe.Width.Type);
			Window.Alert("stop -1");

			lblClickCount.Text = (int.Parse(lblClickCount.Text) + 20).ToString();
			pnlMoveMe.Style[HtmlTextWriterStyle.Left] = (int.Parse(pnlMoveMe.Style[HtmlTextWriterStyle.Left]) + 20) + "px";
			Window.Alert("stop 0");

			// if-else test
			if (int.Parse(lblClickCount.Text) == 0)
				lblClickCount.Text = "1";
			else
				lblClickCount.Text = "5";
			Window.Alert("stop 1");

			// for test
			for (int i = 0; i < 3; ++i)
				lblClickCount.Text = i.ToString();
			Window.Alert("stop 2");

			// while test
			lblClickCount.Text = "1";
			while (int.Parse(lblClickCount.Text) < 4)
				lblClickCount.Text = (int.Parse(lblClickCount.Text) + 1).ToString();

			// if-else inside for test
			for (int i = 0; i <= 2; ++i)
				if (i == 1)
					Window.Alert(i.ToString());
				else
					Window.Alert("no" + i);
		}
	}
}
